import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Rank from '../views/Rank.vue'
import playlistdetail from '../components/playlistdetail/playlistdetail.vue'
import dian from '../components/Dian/Dian.vue'
import Player from '../components/player/Player.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/rank',
    name: 'Rank',
    component:Rank,

    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    // component: () => import(/* webpackChunkName: "about" */ '../views/Rank.vue')
  },{
    path:'/playlistdetail/:id',
    neme:'Playlistdetail',
    component:playlistdetail,
  },{
    path:'/dian/:id',
    name:'Dian',
    component:dian,
  },{
    path:'/player/:id',
    name:'Player',
    component:Player,
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
